package com.wnhz.work.jy.adapter;


import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.wnhz.work.jy.fragment.OrderFragment;

import java.util.List;

/**
 * Created by Administrator on 2016/9/5 0005.
 * -----产品中心
 */
public class ProductAdapter extends FragmentPagerAdapter {
    private List<Fragment> list_fragment; //装fragment的列表
    private List<String> list_title; //tab名的列表

    public ProductAdapter(FragmentManager fm, List<Fragment> list_fragment, List<String> list_title) {
        super(fm);
        this.list_fragment = list_fragment;
        this.list_title = list_title;
    }




    @Override
    public Fragment getItem(int position) {
        return list_fragment.get(position);
    }

    @Override
    public int getCount() {
        return list_title.size();
    }

    //此方法用来显示tab上的名字
    @Override
    public CharSequence getPageTitle(int position) {
        return list_title.get(position % list_title.size());
    }
}
